from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views
from .views import RegisterView, LoginView, CustomTokenObtainPairView
from rest_framework_simplejwt.views import TokenRefreshView

router = DefaultRouter()
router.register(r'environments', views.EnvironmentViewSet)
router.register(r'testcases', views.TestCaseViewSet)
router.register(r'executions', views.TestExecutionViewSet)
router.register(r'reports', views.TestReportViewSet)
router.register(r'daily/logs', views.DailyLogViewSet)

urlpatterns = [
    path('users/register/', RegisterView.as_view(), name='user-register'),
    path('users/login/', LoginView.as_view(), name='user-login'),
    path('users/token/refresh/', TokenRefreshView.as_view(), name='token-refresh'),
    path('', include(router.urls)),
] 